<template>
	<div>
		<el-input v-model="apkFileName" placeholder="文件名称"> </el-input>
		<el-input v-model="apkNum" placeholder="版本号" @keyup.enter.native="handleClick"
			style="width: 300px;margin-left: 20px;"> </el-input>
		<!-- <el-upload
      class="upload-demo"
      action=""
      :http-request="handleUoload"
      :before-upload="beforeAvatarUpload"
      :file-list="fileList"
    >
      <el-button size="small" type="primary">点击上传</el-button>
      <div slot="tip" class="el-upload__tip">上传APK文件</div>
    </el-upload> -->
		<el-button size="small" type="primary" @click="handleClick">确定上传</el-button>
	</div>
</template>

<script>
	import * as syShopApi from "@/api/Add";
	export default {
		data() {
			return {
				apkNum: "",
				apkFileName: "宇航人三山岳系统",
				fileList: [],
			};
		},
		methods: {
			handleUoload(file) {
				this.fileList = [file.file]
			},
			beforeAvatarUpload(file) {

			},
			handleClick() {
				syShopApi.apkInsert({
					apkFileName: this.apkFileName,
					apkNum: this.apkNum
				}).then((res) => {
					if (res.code === 200) {
						this.$message("确定修改")
					}
				});
				// let formData = new FormData()
				// formData.append("file",this.fileList[0])
				// formData.append("apkNum",this.apkNum)
				// syShopApi.apkUpload(formData).then((res) => {
				//   if (res.code === 200) {
				//     this.$message("确定修改")
				//   }
				// });
			},
		},
	};
</script>
